/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sv.com.globalsolutionslt.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author karinaMelara
 */
@Entity
@Table(name = "persona_tipo_jornada", catalog = "bolsadetrabajo", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PersonaTipoJornada.findAll", query = "SELECT p FROM PersonaTipoJornada p"),
    @NamedQuery(name = "PersonaTipoJornada.findByIdPersonaTipoJornada", query = "SELECT p FROM PersonaTipoJornada p WHERE p.idPersonaTipoJornada = :idPersonaTipoJornada")})
public class PersonaTipoJornada implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_persona_tipo_jornada", nullable = false)
    private Integer idPersonaTipoJornada;
    @JoinColumn(name = "id_tipo_jornada", referencedColumnName = "id_tipo_jornada", nullable = false)
    @ManyToOne(optional = false)
    private TipoJornada idTipoJornada;
    @JoinColumn(name = "id_persona", referencedColumnName = "id_persona", nullable = false)
    @ManyToOne(optional = false)
    private Persona idPersona;

    public PersonaTipoJornada() {
    }

    public PersonaTipoJornada(Integer idPersonaTipoJornada) {
        this.idPersonaTipoJornada = idPersonaTipoJornada;
    }

    public Integer getIdPersonaTipoJornada() {
        return idPersonaTipoJornada;
    }

    public void setIdPersonaTipoJornada(Integer idPersonaTipoJornada) {
        this.idPersonaTipoJornada = idPersonaTipoJornada;
    }

    public TipoJornada getIdTipoJornada() {
        return idTipoJornada;
    }

    public void setIdTipoJornada(TipoJornada idTipoJornada) {
        this.idTipoJornada = idTipoJornada;
    }

    public Persona getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(Persona idPersona) {
        this.idPersona = idPersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPersonaTipoJornada != null ? idPersonaTipoJornada.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PersonaTipoJornada)) {
            return false;
        }
        PersonaTipoJornada other = (PersonaTipoJornada) object;
        if ((this.idPersonaTipoJornada == null && other.idPersonaTipoJornada != null) || (this.idPersonaTipoJornada != null && !this.idPersonaTipoJornada.equals(other.idPersonaTipoJornada))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.globalsolutionslt.entidades.PersonaTipoJornada[ idPersonaTipoJornada=" + idPersonaTipoJornada + " ]";
    }
    
}
